home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 376-400 / disk_376 / toollibrary / src / intui1.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  86 lines

  1.  /********************************************************************/
  2.  /****                                                            ****/
  3.  /****                                                            ****/
  4.  /****    Program          : Intui-Funktionen                     ****/
  5.  /****                                                            ****/
  6.  /****    Version          :    02.06                             ****/
  7.  /****                                                            ****/
  8.  /****    Erstversion      : 21.05.1988                           ****/
  9.  /****                                                            ****/
  10.  /****    Letzte Änderung  : 03.08.1990                           ****/
  11.  /****                                                            ****/
  12.  /****    Compiliert mit   : siehe MAKE                           ****/
  13.  /****                                                            ****/
  14.  /****    Gelinkt mit      : Für Tool.Library                     ****/
  15.  /****                                                            ****/
  16.  /********************************************************************/
  17.  /****                                                            ****/
  18.  /****                                                            ****/
  19.  /****               Copyright by Rüdiger Dreier                  ****/
  20.  /****                                                            ****/
  21.  /****                                                            ****/
  22.  /********************************************************************/
  23.  
  24.  #include "ToolProto.h"
  25.  #include <intuition/intuition.h>
  26.  #include <intuition/intuitionbase.h>
  27.  #include <libraries/dos.h>
  28.  #include <graphics/gfxmacros.h>
  29.  #include <exec/memory.h>
  30.  #include <intuition/intuitionbase.h>
  31.  #include <proto/intuition.h>
  32.  #include <proto/graphics.h>
  33.  #include <stdlib.h>
  34.  #include <stdio.h>
  35.  #include <string.h>
  36.  
  37.  
  38.  #define ACTIVE_SCREEN IntuitionBase->ActiveScreen
  39.  #define ACTIVE_WINDOW IntuitionBase->ActiveWindow
  40.  #define CODE  ((Message!=0) ? Message->Code  : 0)
  41.  #define CLASS ((Message!=0) ? Message->Class : 0)
  42.  #define CircleFill(RP,x,y,r) EllFill(RP,x,y,r,r);
  43.  
  44.  extern struct IntuitionBase *IntuitionBase;
  45.  extern struct GfxBase       *GfxBase;
  46.  
  47.  VOID __asm Print(register __a1 struct RastPort *RP,
  48.                   register __a0 char *text,
  49.                   register __d0 LONG col,
  50.                   register __d1 LONG xpos,
  51.                   register __d2 LONG ypos)
  52.   {
  53.    SetAPen(RP,col);
  54.    Move(RP,xpos,ypos);
  55.    Text(RP,text,strlen(text));
  56.   }
  57.  
  58.  /* Funktion, die die Events abfragt                                      */
  59.  /* Parameter : Zeiger auf Fenster und auf Struktur zum Zwischenspeichern */
  60.  
  61.  ULONG __asm EventAbfrage(register __a0 struct Window *Window,
  62.                           register __a1 struct info *MsgInfo)
  63.   {
  64.    struct Message *GetMsg();
  65.    
  66.    /* Struktur leeren */
  67.    /* MsgInfo->Nachricht=0; */
  68.    MsgInfo->NachrichtenArt=0;
  69.    /* MsgInfo->code=0; */
  70.    
  71.    /* Wenn Events, dann Struktur entsprechend füllen */
  72.    if(MsgInfo->Nachricht=(struct IntuiMessage *)GetMsg(Window->UserPort))
  73.     {
  74.      MsgInfo->NachrichtenArt=MsgInfo->Nachricht->Class;
  75.      MsgInfo->code=MsgInfo->Nachricht->Code;
  76.      MsgInfo->IAddress=MsgInfo->Nachricht->IAddress;
  77.      MsgInfo->MouseX=MsgInfo->Nachricht->MouseX;
  78.      MsgInfo->MouseY=MsgInfo->Nachricht->MouseY;
  79.      ReplyMsg((struct Message *)MsgInfo->Nachricht);
  80.     }
  81.    /* Zusätzlich Class zurückgeben, für while-Schleife */
  82.    return(MsgInfo->NachrichtenArt);
  83.   }
  84.  
  85.  
  86.